package summer_vacation.zengguangchuan;

import java.util.Scanner;

/**作业27
 * Created by lenovo0 on 2015/9/1.
 */
public class Assignment_18 {
    public static void main(String[] args){
        System.out.print("请输入a,b,c三个数:");
        Scanner input=new Scanner(System.in);
        double a,b,c;
        a=input.nextInt();
        b=input.nextInt();
        c=input.nextInt();
        double d=b*b-4*a*c;
        if (d==0){
            System.out.println("x="+(-b)/(2*a));
        }
        else if (d<0){
            System.out.println("无解");
        }
        else{
            System.out.println("x1="+(-b+Math.sqrt(d))/(2*a));
            System.out.println("x2="+(-b-Math.sqrt(d))/(2*a));
        }
    }
}

